self.onmessage = function ({ data }) {
  const tableData = data.data
    .map((item, index) => {
      return {
        id: index,
        ...item
      }
    })
    .sort((a, b) => Number(b.t) - Number(a.t))
  const chartData = data.data.map((item) => {
    return [item[data.key1], item[data.key2]]
  })
  self.postMessage({ chartData, tableData })
}
